<!DOCTYPE html>
<html>
<head>
    <title>MVVM</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.mobile.all.min.css" rel="stylesheet" />
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/kendo.all.min.js"></script>
    <script src="../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    
<div data-model="viewModel" data-role="view" id="switch-mvvm" data-title="Switch MVVM">
    <ul data-role="listview" data-style="inset" data-type="group">
        <li>
            Switch
            <ul>
                <li>
                    Check <input data-role="switch"
                                 data-bind="enabled: isEnabled,
                                            visible: isVisible,
                                            checked: isChecked,
                                            events: { change: onChange }">
                </li>
                <li>
                    <div class="console"></div>
                </li>
            </ul>
        </li>
        <li>
            Configuration
            <ul>
                <li>Check <input type="checkbox" data-role="switch" data-bind="checked: isChecked"></li>
                <li>Enable <input type="checkbox" data-role="switch" data-bind="checked: isEnabled"></li>
                <li>Visible <input type="checkbox" data-role="switch" data-bind="checked: isVisible"></li>
            </ul>
        </li>
    </ul>

    <p>
        Kendo UI Mobile Switch supports the
        <a href="http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/checked">checked</a>,
        <a href="http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/enabled">enabled</a>,
        <a href="http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/events">events</a> and
        <a href="http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/visible">visible</a> bindings.
    </p>
</div>

<script>
    var viewModel = kendo.observable({
        isChecked: true,
        isEnabled: true,
        isVisible: true,
        onChange: function(e) {
            kendoConsole.log("event :: change (" +  (e.checked ? "checked" : "unchecked") + ")", false, "#switch-mvvm");
        }
    });
</script>


    
    <script>
        window.kendoMobileApplication = new kendo.mobile.Application(document.body);
    </script>
    
    
</body>
</html>
